Checking out https://pypi.org/project/yfinance/ created by Ran Aroussi


In [17]:
import yfinance as yf
import pandas as pd

goog = yf.Ticker('GOOG')
goog.info


Out[17]:
{'zip': '94043',
 'sector': 'Communication Services',
 'fullTimeEmployees': 118899,
 'longBusinessSummary': 'Alphabet Inc. provides online advertising services in the United States, Europe, the Middle East, Africa, the Asia-Pacific, Canada, and Latin America. It offers performance and brand advertising services. The company operates through Google and Other Bets segments. The Google segment offers products, such as Ads, Android, Chrome, Google Cloud, Google Maps, Google Play, Hardware, Search, and YouTube, as well as technical infrastructure. It also offers digital content, cloud services, hardware devices, and other miscellaneous products and services. The Other Bets segment includes businesses, including Access, Calico, CapitalG, GV, Verily, Waymo, and X, as well as Internet and television services. Alphabet Inc. was founded in 1998 and is headquartered in Mountain View, California.',
 'city': 'Mountain View',
 'phone': '650-253-0000',
 'state': 'CA',
 'country': 'United States',
 'companyOfficers': [],
 'website': 'http://www.abc.xyz',
 'maxAge': 1,
 'address1': '1600 Amphitheatre Parkway',
 'industry': 'Internet Content & Information',
 'previousClose': 1263.47,
 'regularMarketOpen': 1284.85,
 'twoHundredDayAverage': 1313.4237,
 'trailingAnnualDividendYield': None,
 'payoutRatio': 0,
 'volume24Hr': None,
 'regularMarketDayHigh': 1294.03,
 'navPrice': None,
 'averageDailyVolume10Day': 2085383,
 'totalAssets': None,
 'regularMarketPreviousClose': 1263.47,
 'fiftyDayAverage': 1192.9456,
 'trailingAnnualDividendRate': None,
 'open': 1284.85,
 'toCurrency': None,
 'averageVolume10days': 2085383,
 'expireDate': None,
 'yield': None,
 'algorithm': None,
 'dividendRate': None,
 'exDividendDate': None,
 'beta': 1.045841,
 'circulatingSupply': None,
 'startDate': None,
 'regularMarketDayLow': 1271.23,
 'priceHint': 2,
 'currency': 'USD',
 'trailingPE': 26.101948,
 'regularMarketVolume': 1949042,
 'lastMarket': None,
 'maxSupply': None,
 'openInterest': None,
 'marketCap': 879835938816,
 'volumeAllCurrencies': None,
 'strikePrice': None,
 'averageVolume': 2412979,
 'priceToSalesTrailing12Months': 5.4358845,
 'dayLow': 1271.23,
 'ask': 1282,
 'ytdReturn': None,
 'askSize': 1100,
 'volume': 1949042,
 'fiftyTwoWeekHigh': 1532.106,
 'forwardPE': 22.224627,
 'fromCurrency': None,
 'fiveYearAvgDividendYield': None,
 'fiftyTwoWeekLow': 1013.536,
 'bid': 1278,
 'tradeable': False,
 'dividendYield': None,
 'bidSize': 1100,
 'dayHigh': 1294.03,
 'exchange': 'NMS',
 'shortName': 'Alphabet Inc.',
 'longName': 'Alphabet Inc.',
 'exchangeTimezoneName': 'America/New_York',
 'exchangeTimezoneShortName': 'EDT',
 'isEsgPopulated': False,
 'gmtOffSetMilliseconds': '-14400000',
 'quoteType': 'EQUITY',
 'symbol': 'GOOG',
 'messageBoardId': 'finmb_29096',
 'market': 'us_market',
 'annualHoldingsTurnover': None,
 'enterpriseToRevenue': 4.808,
 'beta3Year': None,
 'profitMargins': 0.21218,
 'enterpriseToEbitda': 16.169,
 '52WeekChange': 0.027553558,
 'morningStarRiskRating': None,
 'forwardEps': 57.74,
 'revenueQuarterlyGrowth': None,
 'sharesOutstanding': 342065984,
 'fundInceptionDate': None,
 'annualReportExpenseRatio': None,
 'bookValue': 292.651,
 'sharesShort': 3884707,
 'sharesPercentSharesOut': 0.0057,
 'fundFamily': None,
 'lastFiscalYearEnd': 1577750400,
 'heldPercentInstitutions': 0.69553,
 'netIncomeToCommon': 34343000064,
 'trailingEps': 49.163,
 'lastDividendValue': None,
 'SandP52WeekChange': -0.011489093,
 'priceToBook': 4.384916,
 'heldPercentInsiders': 0.056649998,
 'nextFiscalYearEnd': 1640908800,
 'mostRecentQuarter': 1577750400,
 'shortRatio': 1.66,
 'sharesShortPreviousMonthDate': 1582848000,
 'floatShares': 617966415,
 'enterpriseValue': 778251862016,
 'threeYearAverageReturn': None,
 'lastSplitDate': 1430092800,
 'lastSplitFactor': '10000000:10000000',
 'legalType': None,
 'morningStarOverallRating': None,
 'earningsQuarterlyGrowth': 0.193,
 'dateShortInterest': 1585612800,
 'pegRatio': 1.68,
 'lastCapGain': None,
 'shortPercentOfFloat': None,
 'sharesShortPriorMonth': 3243144,
 'category': None,
 'fiveYearAverageReturn': None,
 'regularMarketPrice': 1284.85,
 'logo_url': 'https://logo.clearbit.com/abc.xyz'}

In [18]:
goog.history(period='12mo')


Out[18]:
Open High Low Close Volume Dividends Stock Splits
Date
2019-04-18 1239.18 1242.00 1234.61 1236.37 1331800 0 0
2019-04-22 1235.99 1249.09 1228.31 1248.84 807300 0 0
2019-04-23 1250.69 1269.00 1246.38 1264.55 1319900 0 0
2019-04-24 1264.12 1268.01 1255.00 1256.00 1018800 0 0
2019-04-25 1264.77 1267.41 1252.03 1263.45 1107300 0 0
... ... ... ... ... ... ... ...
2020-04-13 1209.18 1220.51 1187.60 1217.56 1739800 0 0
2020-04-14 1245.09 1282.07 1236.93 1269.23 2470400 0 0
2020-04-15 1245.61 1280.46 1240.40 1262.47 1671700 0 0
2020-04-16 1274.10 1279.00 1242.62 1263.47 2507100 0 0
2020-04-17 1284.85 1294.43 1271.23 1283.25 1947900 0 0

252 rows × 7 columns


In [19]:
goog.dividends


Out[19]:
Series([], Name: Dividends, dtype: int64)

In [20]:
goog.financials


Out[20]:
Open High Low Close Adj Close Volume
Date

In [21]:
goog.quarterly_financials


Out[21]:
Open High Low Close Adj Close Volume
Date

In [22]:
goog.balance_sheet


Out[22]:
Open High Low Close Adj Close Volume
Date

In [23]:
msft = yf.Ticker('MSFT')
msft.balance_sheet


Out[23]:
Open High Low Close Adj Close Volume
Date

In [24]:
msft.options


Out[24]:
('2020-04-23',
 '2020-04-30',
 '2020-05-07',
 '2020-05-14',
 '2020-05-21',
 '2020-05-28',
 '2020-06-18',
 '2020-07-16',
 '2020-09-17',
 '2020-10-15',
 '2020-12-17',
 '2021-01-14',
 '2021-03-18',
 '2021-06-17',
 '2021-09-16',
 '2022-01-20',
 '2022-03-17',
 '2022-06-16',
 '2022-09-15')

In [25]:
msft.calendar


Out[25]:
Value
Earnings Date 2020-04-29 00:00:00
Earnings Average 1.29
Earnings Low 1.17
Earnings High 1.43
Revenue Average 34081900000
Revenue Low 32796000000
Revenue High 35111000000

In [26]:
msft.recommendations


Out[26]:
Firm To Grade From Grade Action
Date
2012-03-16 Argus Research Buy up
2012-03-19 Hilliard Lyons Long-Term Buy main
2012-03-22 Morgan Stanley Overweight main
2012-04-03 UBS Buy main
2012-04-20 Goldman Sachs Neutral main
... ... ... ... ...
2020-03-17 Deutsche Bank Buy main
2020-03-25 Morgan Stanley Overweight main
2020-03-31 Piper Sandler Overweight main
2020-03-31 Citigroup Neutral main
2020-04-03 Raymond James Strong Buy main

271 rows × 4 columns